<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   <%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理员列表</title>
<link href="../style/css_member.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/common.js"></script>
<script src="../js/artDialog.js?skin=gray"></script>
<script src="../js/artDialog.iframeTools.js"></script>
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script type="text/javascript">

function removeUser(id){

	if(window.confirm("您确认删除该管理员账号？")){
		window.location.href = "${ctx}/security/user!remove.do?ids="+id;
	}
}

$(function(){
	
	$("a[name='modifyHref']").click(function(){
		var id = $(this).attr("title");
		art.dialog.open('${ctx}/security/user!edit.do?id='+id,{title:'修改用户',width:800,height:550,lock:true},false);
    });

	$("a[name='modifyRoleHref']").click(function(){
		var id = $(this).attr("title");
		art.dialog.open('${ctx}/security/user!rolesByUser.do?id='+id,{title:'修改用户角色',width:800,height:550,lock:true},false);
    });
	
	m2('m1_008','m1_008_02');
});

</script>
</head>
<body>
<!-- 页面头部  -->
<jsp:include page="/commons/head_member.jsp"></jsp:include>

<form action="${ctx }/security/user!list.do" method="post" id="memeber_list_form" name="memeber_list_form">
<table width="960" border="0" cellpadding="0" cellspacing="0" class="tbl_border" align="center">
<tr><td style="padding-top: 20px;;padding-bottom: 20px;">
       <table width="900" border="0" cellspacing="0" cellpadding="0" align="center" class="tbl" style="margin: 0 auto;">
                <tr bgcolor="#CDE1ED">
					<td height="35">序号</td>
			        <td>姓名</td>
			        <td width="20%">角色</td>
			        <td width="40%">权限</td>
			        <td>操作记录</td>
			        <td>管理</td>
				</tr>
				<c:forEach var="user" items="${list}" varStatus="status">
					<tr>
						<td height="30">${status.count }</td>
						<td>${user.username }</td>
						<td>
							<c:forEach var="role" items="${user.roles}">
							  ${role.name } <br/>	
							</c:forEach>
						</td>
						<td><div align="left">
							<c:forEach var="role" items="${user.roles}">
							  	<c:forEach var="menu" items="${role.menus}" varStatus="status1">
							 	 	${menu.descn }&nbsp;&nbsp;<c:if test="${status1.count mod 3 == 0}"><br/></c:if>	
								</c:forEach>
							</c:forEach></div>
						</td>
						<td>查看</td>
						<td>
						 <a href="javascript:removeUser(${user.id })"  style="color: blue;cursor: pointer">删除</a>&nbsp;
                     	 <a name="modifyHref" title="${user.id }" style="color: blue;cursor: pointer">修改</a>&nbsp;
                     	 <a name="modifyRoleHref" title="${user.id }" style="color: blue;cursor: pointer">角色</a>&nbsp;
                     </td>
					</tr>
				</c:forEach>
     </table>
</td></tr>
</table>
</form>

<!-- 页面底部 -->
<jsp:include page="/commons/foot.jsp"></jsp:include>
</body>
</html>